//
//  AIMineRuleController.m
//  ZJCLoveBee
//
//  Created by 朱建超 on 16/12/24.
//  Copyright © 2016年 itHeiMa. All rights reserved.
//

#import "AIMineRuleController.h"
#import "AIMineRuleCell.h"

@interface AIMineRuleController ()<UITableViewDelegate,UITableViewDataSource>

@end

static NSString *ruleID = @"ruleID";
static NSString *lastRuleCellID = @"lastRuleCellID";

@implementation AIMineRuleController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)setupUI{

    UITableView *tableView = [[UITableView alloc] init];
    
    [self.view addSubview:tableView];
    
    tableView.delegate = self;
    tableView.dataSource = self;
    [tableView registerNib:[UINib nibWithNibName:@"AIMineRuleCell" bundle:nil] forCellReuseIdentifier:ruleID];
    [tableView registerNib:[UINib nibWithNibName:@"AIMineLastRuleCell" bundle:nil] forCellReuseIdentifier:lastRuleCellID];
    tableView.rowHeight = 150;
    tableView.separatorStyle = NO;
    
    [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.right.bottom.mas_equalTo(self.view);
        
    }];

}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 8;

}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 7) {
        
        AIMineRuleCell *ruleCell = [tableView dequeueReusableCellWithIdentifier:lastRuleCellID forIndexPath:indexPath];

        
        return ruleCell;
        
    }
    
    AIMineRuleCell *ruleCell = [tableView dequeueReusableCellWithIdentifier:ruleID forIndexPath:indexPath];
    
    return ruleCell;
    
    
    
    
    
    

}

@end
